﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="OTA.Notification.Web.Message.WebMsgList" Codebehind="WebMsgList.aspx.cs" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Web message list</title>
    <link href="../../Style/main.css" type="text/css" rel="stylesheet" />

    <script src="../../common/jquery-1.2.6.min.js"></script>

    <script src="../../common/jquery-impromptu.1.5.js"></script>

    <script src="../../common/flexigrid/flexigrid.js"></script>

    <link rel="stylesheet" href="../../common/flexigrid/flexigrid.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="../../style/dfbDialog.css" type="text/css" media="screen" />

    <script type="text/javascript" charset="utf-8">
	
		$(document).ready(function(){
		
		    $('#grid').flexigrid({
		    
		        width: $(document).width() - 10,
		        height: 400,
		        //striped:false,
		        
		        url:'?action=get',
		        
		        dataType: 'json',
		        
		        colModel: [
		            {display: '重要性', name : 'level', width : 100, sortable : false, align: 'center'}, 
                    {display: '发送者', name : 'sender', width : 100, sortable : false, align: 'center'},   
                    {display: '接收者', name : 'reciver', width : 180, sortable : false, align: 'left'},   
                    {display: '消息产生时间', name : 'createdate', width : 300, sortable : false, align: 'left'},
                    {display: '消息阅读时间', name : 'readdate', width : 60, sortable : false, align: 'left'},
                    {display: '消息标题', name : 'title', width : 60, sortable : false, align: 'left'}
                ],
                
                singleSelect: true,
                
                buttons : [
                    { name: '删除', onpress: doCommand},  
                    { separator: true}   
                ], 
                
                showTableToggleBtn: true,
                rp: 15,
                usepager: true,
                useRp: true
		    });
		    

		    $('#btnsearch').click(function (){

                var params = "";
                
    		    var objselect = $('#txtTitle').val();
    		    
                //var state = $('input[@name=state][@checked]').val(); 
                //alert(objselect);
                params = objselect;
                
		        $('#grid').flexOptions({ query: params }).flexReload();

		    });
		    
		});
		
		
		function doCommand(com, grid){
		
            if($('.trSelected', grid)[0] == null) return;
            
            var tcode = $('.trSelected', grid)[0].id.replace(/row/,"");
            
            if(tcode != ''){
            
                if(confirm("是否确认要删除？")){
                        
                    var data = { key1: tcode };
                    
                    $.post("webmsglist.aspx?action=del", data, 
                    
                        function(data, state){
                            doRefresh();
                            
                    }, "json");
                }
            }
            
        }		
        
        function doRefresh(){
            $('#grid').flexOptions().flexReload();
        }
        
        
    </script>

</head>
<body>
    <form id="form1" runat="server"></form>
    <div class="menu_title">
        Web消息事件列表
    </div>
    <div>
        <table>
            <tr>
                <td>
                    消息标题：
                </td>
                <td>
                    <input id="txtTitle" type="text" Class="text-area" /><input id="btnsearch" type="button" value="Search"
                        class="button" />
                </td>
            </tr>
        </table>
        <div>
            Web消息事件详细信息:</div>
        <table id="grid">
        </table>
    </div>
    
</body>
</html>
